	@include('admin.head')
	<style>
	.search-field
	{
		margin-bottom: -1px!important;
		margin-top: 1px!important;
		width: 20%!important;
	}
	</style>
	<div class="container">
		<div class="row">
			@include('admin.side')
			<div class="col-md-10" id="content-wrapper">
				<div class="row" style="min-height:500px;">
					<div class="col-lg-12">
						<div class="row">
							<div class="col-lg-12">
								<div class="main-box clearfix">
									<div class="table-responsive">
										<div class="col-xs-1" style="float:right">
								  			<a href="<%url('admin/tech/add_tech')%>"><button class="btn btn-primary pull_right" pid="" id=""><i class="fa fa-plus"></i></i> 添加</button></a>
								  		</div>
										<table class="table user-list" id="all-techs">
											<thead>
												<tr>
													<th data-column-id="id"><span>ID</span></th>
													<th data-column-id="tech_name" data-sortable="false"><span>技术名称</span></th>
													<th data-column-id="description" data-formatter="description" data-sortable="false"><span>技术描述</span></th>
													<th data-column-id="developer" data-sortable="false"><span>技术开发者</span></th>
													<th data-column-id="efficiency" data-sortable="false"><span>节能效益</span></th>
													<th data-column-id="verify_state" data-formatter="verifystate" data-sortable="false"><span>状态</span></th>
													<th data-sortable="false" data-formatter="commands"><span>操作</span></th>
												</tr>
											</thead>
											<tbody>
											</tbody>
										</table>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	@include("admin.footer")
	@include("admin.common")
</body>

<script type="text/javascript">

	var labelsSetting = {
		infos: "当前第 {{ctx.start}} 条 到 {{ctx.end}} 条 共 {{ctx.total}} 条数据",
		search: "搜索",
		loading: "正在加载...",
		noResults: "未找到您要的数据...",
		refresh: "刷新",
		all: "全部"
	};
	$("#all-techs").bootgrid({
		rowCount: [10, 25, 50],
	    ajax:true,
	    url: "tech/tech_list",
	    labels:labelsSetting,
	    formatters: {
	    	"commands": function(k,row){
	    		return '<a href="javascript:void(0);" tid="'+row.id+'" class="table-link doEdit"><span class="fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-pencil fa-stack-1x fa-inverse"></i></span></a>' + '<a href="javascript:void(0);" tid="'+row.id+'" class="table-link doDetail"><span class="fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-search-plus fa-stack-1x fa-inverse"></i></span></a>';
	    	},
	    	"description" : function(k, v){
	    		if(v.description.length > 20){
	    			return v.description.substr(0,19);
	    		}else{
	    			return v.description;
	    		}
	    	},
	    	"verifystate" :function(k, v){
	    		if(v.verify_state == 0){
	    			return "未审核";
	    		}
	    		if(v.verify_state == 1){
	    			return "已审核通过";
	    		}
	    		if(v.verify_state == 2){
	    			return "审核未通过";
	    		}
	    	}
	    }
	}).on("loaded.rs.jquery.bootgrid", function (e)
    {
    	$(".doEdit").bind('click',function(){
    		var tid = $(this).attr('tid');
    		window.location.href="tech/edit_tech?tid="+tid;
    	})

    	$(".doDetail").bind("click", function(){
    		var tid = $(this).attr("tid");
    		window.location.href="tech/detail_tech?tid="+tid;
    	})
    });
	$(".btn-group").hide();

	$("#sub").click(function(){
		var name = $("input[name='name']").val.trim();
	})

</script>
</html>